/*
    <one line to give the library's name and an idea of what it does.>
    Copyright (C) 2015  <copyright holder> <email>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/


#ifndef BEEP_H
#define BEEP_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <termios.h> 
#include <linux/input.h>
#include <ostream>
using namespace std;

#define PWM_IOCTL_STOP     0
#define PWM_IOCTL_SET_FREQ 1




class beep
{
private:
	string device_file;
	int    fd;
public:
beep(){}
beep(string file);
virtual ~beep();

public:
	void beep_open();
	void beep_freq_seting(unsigned int freq);
	void beep_close();
	void beep_stop();
	void beep_ring(unsigned int ms);
	void beep_ring(unsigned freq, unsigned int ms);
	void beep_music();
};

#endif // BEEP_H
